//
// Decompiled by Jadx - 387ms
//
package gc;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedHelpers;
import fg.f;
import fi.b;
import fi.e;
import fi.w;
import fn.j;
import fn.y;
import java.util.List;
import me.plusne.NativeTools;
import me.plusne.common.Json.JsonHookStatic;

public class ck$c extends XC_MethodReplacement {
    public static final int a = 0;
    public final ck b;

    public ck$c(ck ckVar) {
        this.b = ckVar;
    }

    public final Object replaceHookedMethod(XC_MethodHook.MethodHookParam methodHookParam) {
        String str;
        String str2;
        int i;
        w wVar;
        ck ckVar = this.b;
        Object obj = ckVar.cq;
        if (obj == null) {
            return j.w(methodHookParam);
        }
        String as = j.as(obj, "authorIdEcpt");
        String as2 = j.as(ckVar.cq, "postIdEcpt");
        if (as.equals("cEsyTExOcWNjenhXd21kamhjaHVqdz09")) {
            JsonHookStatic jsonHookStatic = y.by;
            if (jsonHookStatic.getUserInfo() != null && NativeTools.n(JsonHookStatic.l, jsonHookStatic.getUserInfo()) && jsonHookStatic.getUserInfo().getExp() == 0) {
                w wVar2 = new w(jsonHookStatic.getActivity());
                wVar2.bj(fi.e.MESSAGE);
                wVar2.bi("隐身瞬间");
                wVar2.bc("是否检测并进入Ta的主页");
                wVar2.bg("进入主页");
                wVar2.v = new f(9, this, as2);
                wVar2.bk();
                return null;
            }
        }
        if (!j.ae("postAuto")) {
            return j.w(methodHookParam);
        }
        Enum r1 = (Enum) XposedHelpers.getObjectField(ckVar.cq, "type");
        if ("IMAGE".equals(r1.name())) {
            wVar = new w(y.by.getActivity());
            wVar.bj(fi.e.MESSAGE);
            wVar.aj = "自动检测";
            wVar.bb();
            wVar.ak = "检测到瞬间为图片瞬间,是否下载当前瞬间图片";
            wVar.bb();
            wVar.r = "下载";
            wVar.bb();
            wVar.v = new f(10, this, methodHookParam);
        } else if ("AUDIO".equals(r1.name())) {
            List list = (List) XposedHelpers.getObjectField(ckVar.cq, "attachments");
            if (list == null) {
                return j.w(methodHookParam);
            }
            if (!list.isEmpty()) {
                String as3 = j.as(list.get(0), "fileUrl");
                String as4 = j.as(list.get(0), "audioName");
                str2 = as3;
                i = XposedHelpers.getIntField(list.get(0), "fileDuration");
                str = as4;
            } else {
                str = "";
                str2 = str;
                i = 0;
            }
            wVar = new w(y.by.getActivity());
            b bVar = new b();
            wVar.bj(fi.e.LIST_ITEM);
            wVar.aj = "自动检测";
            wVar.bb();
            wVar.bc("检测到瞬间为语音瞬间,选择操作");
            bVar.b("下载语音");
            bVar.b("复制语音Url");
            bVar.b("收藏语音");
            bVar.b("默认操作");
            wVar.ay(bVar);
            wVar.ae = new cl(this, str, str2, i, methodHookParam);
        } else {
            return j.w(methodHookParam);
        }
        wVar.bk();
        return null;
    }
}
